/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Controlador;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

/**
 *
 * @author Isaac Paliza <anndysaac@hotmail.com>
 */
public class CTRL_Documento {
    private static final ConnectionJDBC connectionJDBC = new ConnectionJDBC();
    private static final Statement statement = connectionJDBC.createStatement();
    public static String Mensaje;
    
    public static String AgregarNuevoDocumento(int idDocumento, 
            String idTipoDocumento, String nombre) throws SQLException {
        
        String sql = "INSERT INTO t_documento (idDocumento, idTDocumento, proveedor) "
                + "VALUES (" + idDocumento+", "+idTipoDocumento+", '"+nombre+"' "+ ")";
        try {
            statement.execute(sql);
            return "bien";
        } catch (SQLException e) {
            return "error";
        }
    }
}
